<extend name="Public:base" />

<block name="additional-styles">
	<!-- DataTables -->
	<link rel="stylesheet" href="__PUBLIC__/Admin/plugins/datatables/dataTables.bootstrap.css" />
</block>

<block name="content-wrapper">
	<!-- Content Wrapper. Contains page content -->
	<div class="content-wrapper">
		<!-- Content Header (Page header) -->
		<section class="content-header">
			<h1>
				我的逻辑班级
				<small>My Logic Class</small>
			</h1>
			<ol class="breadcrumb">
				<li>
					<a href="{:U('Index/index')}"> <i class="fa fa-dashboard"></i>
						首页
					</a>
				</li>
				<li class="active">我的逻辑班级</li>
			</ol>
		</section>

		<!-- Main content -->
		<section class="content">
			<div class="row">
				<div class="col-xs-12">
					<div class="box">
						<div class="box-header">
							<!-- <h3 class="box-title">Data Table With Full Features</h3>-->
							<div class="row">
								<div class="col-xs-1 pull-right">
									<a href="{:U('MyLogicClass/join')}" type="button" class="btn btn-block btn-primary">加入</a>
								</div>
							</div>
						</div>
						<!-- /.box-header -->
						<div class="box-body">
							<table id="example1" class="table table-bordered table-striped">
								<thead>
									<tr>
										<th>逻辑班级ID</th>
										<th>逻辑班级名称</th>
										<th>授课教师</th>
										<th>所授课程</th>
									</tr>
								</thead>
								<tbody>
									<volist name="logic_classes" id="vo">
										<tr>
											<td>{$vo.id}</td>
											<td>{$vo.name}</td>
											<td>
												<php>$academy = get_academy_by_id($vo['teacher']['academy_id'])</php>
												{$academy.name}&nbsp;&nbsp;{$vo.teacher.name}
											</td>
											<td>
												<php>
													$major = get_major_by_id($vo['course']['major_id']);
													$academy = get_academy_by_id($major['academy_id']);
												</php>
												{$academy.name}&nbsp;&nbsp;{$major.name}&nbsp;&nbsp;{$vo.course.name}
											</td>
										</tr>
									</volist>
								</tbody>
								<tfoot>
									<tr>
										<th>逻辑班级ID</th>
										<th>逻辑班级名称</th>
										<th>授课教师</th>
										<th>所授课程</th>
									</tr>
								</tfoot>
							</table>
						</div>
						<!-- /.box-body -->
					</div>
					<!-- /.box -->
				</div>
			</div>
		</section>
		<!-- /.content -->
	</div>
	<!-- /.content-wrapper -->
</block>

<block name="additional-scripts">
	<!-- DataTables -->
	<script src="__PUBLIC__/Admin/plugins/datatables/jquery.dataTables.min.js"></script>
	<script src="__PUBLIC__/Admin/plugins/datatables/dataTables.bootstrap.min.js"></script>
	<script>
		$(function () {
			$("#example1").DataTable();
			$('#example2').DataTable({
				"paging": true,
				"lengthChange": false,
				"searching": false,
				"ordering": true,
				"info": true,
				"autoWidth": false
			});
		});
	</script>
</block>